package car.manager;

import java.util.Calendar;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

public class DataBaseConnection extends SQLiteOpenHelper {

	 public static final int VERSION = 1;
   
	 //Tables names
	 public static final String DB_NAME = "car_manager.sqlite";
     public static final String PROFILE_TABLE = "profile";
     public static final String GARAGE_TABLE = "garage";
     public static final String CAR_TABLE = "car";
     public static final String LOCATION_TABLE = "location";
     public static final String COUNTRTY_TABLE = "country";
     public static final String CITY_TABLE = "car";
     
     //LOCATION TABLE
     public static final String LOCATION_REGION = "REGION";
     public static final String LOCATION_LATTITTUDE = "latittude";
     public static final String LOCATION_LONGITTUDE = "longitude";

     //PROFILE TABLE
     public static final String PROFILE_ID = "id";
     public static final String PROFILE_NAME = "name";
     public static final String PROFILE_CREDIT = "credit";
     public static final String PROFILE_EXPERIENCE = "experience";

     //GRAGE TABLE
     public static final String GARAGE_ID = "id";
     public static final String GARAGE_NAME = "name";
     public static final String GARAGE_CAPACITYT = "capacity";
     public static final String GARAGE_DATE_OF_CREATION = "date_of_creation";
     public static final String GARAGE_NUMBER_OF_CARS = "date_of_creation";

     //CAR TABLE
     public static final String CAR_ID = "id";
     public static final String CAR_BRAND = "brand";
     public static final String CAR_MODEL = "model";
     public static final String CAR_LICENSING_PLATE = "icense_plate";
     public static final String CAR_DATE_OF_CREATION = "date_of_creation";
     public static final String CAR_COLOR = "color";
     public static final String CAR_CONDITION = "condition";
     public static final String CAR_MILAEGE = "mileage";
     public static final String CAR_MARKET_VALUE = "market_value";
     public static final String CAR_DISPLAY_FOTO = "display_foto";
     public static final String CAR_SECUNDARY_FOTO1 = "foto1";
     public static final String CAR_SECUNDARY_FOTO2 = "foto2";
     public static final String CAR_SECUNDARY_FOTO3 = "foto3";

	

	
	public DataBaseConnection(Context context){
		super(context, DB_NAME, null, VERSION);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {

		createTable(db);
	}

	private void createTable(SQLiteDatabase db) {

		db.execSQL(
				"create table " + PROFILE_TABLE +" (" +
						PROFILE_ID + " integer primary key autoincrement not null," +
						PROFILE_NAME + " text," +
						PROFILE_CREDIT + " float," +
						PROFILE_EXPERIENCE + " float" +
						
						");"
						);
						}
		
	

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		// TODO Auto-generated method stub

	}

}
